<?php 
header("content-type:text/html;charset=utf-8");
session_start();
if(isset($_SESSION["u_user"])) {
	$name = $_SESSION["u_user"];
	include_once('classes/depart/depart.class.php');
	include_once('classes/page.class.php');
	$depart = new depart();
	$num = $depart->get_count_depart('del="1"');
	$page = new page($num);
	$depart_info = $depart->get_all_depart();
?>

   <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="utf-8">
        <title>管理</title>
        <meta name="description" content="mobile first, app, web app, responsive, admin dashboard, flat, flat ui">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <link rel="stylesheet" href="caches/css/bootstrap.css">
        <link rel="stylesheet" href="caches/css/font-awesome.min.css">
        <link rel="stylesheet" href="caches/css/style.css">
        <link rel="stylesheet" href="caches/css/plugin.css">
        <link rel="stylesheet" href="caches/css/landing.css">
        <!--[if lt IE 9]>
        <script src="caches/js/ie/respond.min.js"></script>
        <script src="caches/js/ie/html5.js"></script>
        <![endif]-->
    </head>
    <body>
    <!-- header -->
    <header id="header" class="navbar">
        <ul class="nav navbar-nav navbar-avatar pull-right">
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    <span class="hidden-sm-only"></span>
                    <span class="thumb-small avatar inline"><img src="caches/images/avatar.jpg" alt="" class="img-circle"></span>
                    <b class="caret hidden-sm-only"></b>
                </a>
                <ul class="dropdown-menu">
                    <li class="icon-gear"><span class="text"><a href="#">设置</a></span></li>
                    <li class="divider"></li>
                    <li class="icon-signout"><span class="text"><a href="quit.php">注销</a></span></li>
                </ul>
            </li>
        </ul>
        <a class="navbar-brand" href="#">管理</a>
        <button type="button" class="btn btn-link pull-left nav-toggle hidden-lg" data-toggle="class:slide-nav slide-nav-left" data-target="body">
            <i class="icon-reorder icon-xlarge text-default"></i>
        </button>
        <ul class="nav navbar-nav hidden-sm">
            <li class="dropdown shift" data-toggle="shift:appendTo" data-target=".nav-primary .nav">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-cog icon-xlarge visible-sm visible-sm-inline"></i>设置<b class="caret hidden-sm-only"></b></a>
                <ul class="dropdown-menu">
                    <li>
                        <a href="#" data-toggle="class:navbar-fixed" data-target='body'>
                            <span class="text-active">自动</span>
                            <span class="text">固定</span>
                        </a>
                    </li>
                    <li class="visible-lg">
                        <a href="#" data-toggle="class:nav-vertical" data-target="#nav">
                            <span class="text-active">垂直</span>
                            <span class="text">水平</span>
                        </a>
                    </li>
                    <li class="divider hidden-sm"></li>
                    <li class="dropdown-header">颜色</li>
                    <li>
                        <a href="#" data-toggle="class:bg bg-black" data-target='.navbar'>上：
                            <span class="text-active">白色</span>
                            <span class="text">黑色</span>
                        </a>
                    </li>
                    <li>
                        <a href="#" data-toggle="class:bg-light" data-target='#nav'>左：
                            <span class="text-active">暗</span>
                            <span class="text">亮</span>
                        </a>
                    </li>
                </ul>
            </li>
        </ul>
    </header>
    <nav id="nav" class="nav-primary visible-lg nav-vertical">
        <ul class="nav" data-spy="affix" data-offset-top="50">
            <li class="dropdown-submenu">
                <a href="#"><i class="icon-group icon-xlarge"></i>部门</a>
                <ul class="dropdown-menu">
                    <li><a href="add_depart.php">新增</a></li>
                    <li><a href="department.php">编辑</a></li>
                </ul>
            </li>
            <li class="dropdown-submenu">
                <a href="#"><i class="icon-male icon-xlarge"></i>员工</a>
                <ul class="dropdown-menu">
                    <li><a href="add_user.php">新增</a></li>
                    <li><a href="users.php">编辑</a></li>
                </ul>
            </li>
            <li><a href="admin.php"><i class="icon-edit icon-xlarge"></i>加班信息</a></li>
            <li class="dropdown-submenu">
                <a href="#"><i class="icon-signout icon-xlarge"></i>其他</a>
                <ul class="dropdown-menu">
                    <li><a href="quit.php">注销</a></li>
                </ul>
            </li>
        </ul>
    </nav>


        <!-- 内容区域 -->
       <section id="content">
    <section class="main padder">
      <div class="clearfix">
        <h4><i class="icon-group"></i>部门信息</h4>
      </div>
      <div class="row">
          <div class="panel">
            <div class="clearfix">
				<div  class="col-md-8" align="center" >
					<table  class="table table-striped table-condensed">
					<div  class="col-md-8" align="center" >
						<table  class="table table-striped table-condensed">
							<tr>
								<th>部门</th>
                                <th>管理</th>
                             </tr>
							<?php for($i=0;$i<count($depart_info);$i++){
							?>
                            <tr>
								<td><?php echo $depart_info[$i]['d_name']?></td>
                                <td>
								<div class="tpl-table-black-operation">
                                    <a href="update_depart.php?did=<?php echo $depart_info[$i]['d_id'];?>"><i class="am-icon-pencil"></i> 编辑</a>
                                    <a href="delete_depart.php?did=<?php echo $depart_info[$i]['d_id'];?>" class="tpl-table-black-operation-del"><i class="am-icon-trash"></i> 删除</a>
                                    </div>
                                </td>
                            </tr>
                            <?php }?>
										
                         </table>
                       </table>
                   </div>
					<div  class="col-md-8" align="center" >
					<table  class="table table-striped table-condensed">
						<div  class="col-md-8" align="center" >
							<table><td colspan="6"><?php echo $page->fpage();?></td></table>
						</div>
					</table>
				</div>
			</div>
		</div>
	</div>
  </section>
  </section>
    <footer id="footer">
        <div class="text-center padder clearfix">
            <p>
                <small>&copy;山东舜网传媒股份有限公司</small><br><br>
            </p>
        </div>
    </footer>
    <!-- / footer -->
    <script src="caches/js/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="caches/js/bootstrap.js"></script>
    <!-- app -->
    <script src="caches/js/app.js"></script>
    <script src="caches/js/app.plugin.js"></script>
    <script src="caches/js/app.data.js"></script>
    <!-- fuelux -->
    <script src="caches/js/fuelux/fuelux.js"></script>
    <!-- datepicker -->
    <script src="caches/js/datepicker/bootstrap-datepicker.js"></script>
    <!-- slider -->
    <script src="caches/js/slider/bootstrap-slider.js"></script>
    <!-- file input -->
    <script src="caches/js/file-input/bootstrap.file-input.js"></script>
    <!-- combodate -->
    <script src="caches/js/combodate/moment.min.js"></script>
    <script src="caches/js/combodate/combodate.js"></script>
    <!-- parsley -->
    <script src="caches/js/parsley/parsley.min.js"></script>
    </body>
    </html>
<?php 
}
else
{
	echo '<script>alert("请先登录");location.href="login.php";</script>';
}

?>